package clothing.database;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.DriverManager;
public class MValidation {
	dbase db;
	public MValidation() {
		db = new dbase();
	}

	String emtype;
	
	public boolean getManager(String username)
	{
		String query = "Select count(*) from employees where EMP_MAN = 'Manager' AND username='"+username+"'";
		
		this.db.open();
		try {
			Statement s = this.db.getConn().createStatement();
			ResultSet rs = s.executeQuery(query);
			
			rs.next();
			int count = rs.getInt(1);
			if(count>=1)
				return true;
			
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return false;
	}

}
